﻿<UserControl xmlns:igEditors="http://infragistics.com/Editors"  
             x:Class="BeeCoders.Tools.ControlCanvas.Controls.LabelControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:vm="clr-namespace:BeeCoders.Tools.ControlCanvas"
             xmlns:Infrastructure="clr-namespace:BeeCoders.Tools.ControlCanvas.Infrastructure" 
             xmlns:InputControls="clr-namespace:BeeCoders.Tools.ControlCanvas.Controls" mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance vm:ControlViewModelDemo, IsDesignTimeCreatable=True}"
             d:DesignHeight="28" d:DesignWidth="200"
             KeyboardNavigation.TabNavigation="Local">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisible"></BooleanToVisibilityConverter>
        <Infrastructure:BooleanToHiddenVisibility x:Key="BoolToHidden"></Infrastructure:BooleanToHiddenVisibility>
        <Infrastructure:TrueToFalse x:Key="TrueToFalse"></Infrastructure:TrueToFalse>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="20" />
        </Grid.ColumnDefinitions>

        <!-- Properties popup and button-->
        <Popup Margin="10,10,0,0" Name="PropPopup" HorizontalAlignment="Left"
               VerticalAlignment="Top" 
               PlacementTarget="{Binding ElementName=PropButton}"
               Width="500" Height="500" 
               IsOpen="{Binding ElementName=PropButton,Path=IsChecked}"
               IsHitTestVisible="{Binding Path=IsInDesign}">

            <InputControls:InputControlPropertyView DataContext="{Binding}"></InputControls:InputControlPropertyView>
        </Popup>

        <InputControls:ControlPropertyHandleView x:Name="PropButton" Grid.Column="1"></InputControls:ControlPropertyHandleView>

        <TextBlock Grid.Column="1" Grid.RowSpan="2" IsHitTestVisible="True" Visibility="{Binding Path=IsInDesign, Converter={StaticResource BoolToHidden}}" ></TextBlock>

        <Border BorderBrush="Gray" 
                BorderThickness="1"
                Grid.RowSpan="2"
                Visibility="{Binding Path=IsInDesign, Converter={StaticResource BoolToVisible}}" 
                IsHitTestVisible="{Binding IsInDesign, Converter={StaticResource TrueToFalse}}"/>

        <Label Content="{Binding Prompt}" 
                   IsHitTestVisible="{Binding IsInDesign, Converter={StaticResource TrueToFalse}}">

        </Label>




    </Grid>


</UserControl>
